---
version: "2"
services:
  monitor:
    image: docker.repo:5000/monitor:{{ image_version }}
    restart: always
    ports:
        - "8081:80"
  demo:
    image: docker.repo:5000/hejia_demo:{{ image_version }}
    restart: always
    ports:
        - "8082:80"

  # cello restserver service
  crest:
    image: docker.repo:5000/cello-restserver:2.1
    container_name: cello-restserver
    hostname: cello-restserver
    restart: unless-stopped
    environment:
      - MONGO_URL=mongodb://mongo:27017
      - MONGO_DB=prod
      - DEBUG=False    # in debug mode, service will auto-restart
      - LOG_LEVEL=INFO  # what level log will be output
      - LOGGING_LEVEL_CLUSTER=INFO  # the level log for the cluster in pool
    expose:
      - "80"

  mongo:
    image: docker.repo:5000/mongo:3.2
    hostname: mongo
    container_name: mongo
    restart: unless-stopped
    mem_limit: 2048m
    volumes:
      - ./mongo:/data/db

  dashboard:
      image: docker.repo:5000/baas-dashboard:{{ portal_version }}
      container_name: baas-dashboard
      hostname: baas-dashboard
      ports:
          - "8208:8080"
      environment:
          - TZ=Asia/Shanghai
          - RESTful_Server=restserver:8108
          - PoolManager_Server=crest
      volumes:
          - ./dashboard:/data/db
      depends_on:
          - restserver
      links:
          - restserver
          - crest

  restserver:
      image: docker.repo:5000/baas-restserver:{{ portal_version }}
      container_name: baas-restserver
      hostname: baas-restserver
      ports:
          - "8108:8108"
          - "8109:3306"
      environment:
          - TZ=Asia/Shanghai
          - POOLMANAGER_URL=http://crest
          - POOLMANAGER_VER=v2
